// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/books',
    name: 'books',
    component: () => import('../views/BooksView.vue')
  },
  {
    path: '/books/create',
    name: 'create-book',
    component: () => import('../views/CreateBookView.vue')
  },
  {
    path: '/books/batch-import',
    name: 'batch-import',
    component: () => import('../views/BatchImportView.vue')
  },
  {
    path: '/books/:id',
    name: 'book-detail',
    component: () => import('../views/BookDetailView.vue'),
    props: true
  },
  {
    path: '/books/search',
    name: 'search-books',
    component: () => import('../views/SearchBooksView.vue')
  },
  {
    path: '/borrow',
    name: 'borrow-management',
    component: () => import('../views/BorrowManagementView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router